<?php
namespace Tbf\Crypto\Password\Verify;
use Tbf\Crypto\Password\VerifyInterface;
/**
* crypt 密码方案
 * @deprecated
 *
*/
class BcryptVerify implements VerifyInterface{
	function verify($plain,$hashed){
		return crypt($plain,$hashed)===$hashed;
	}
	static $support_id = array(
		'2a','2x','2y',
		);
	/**
	* 不支持DES方案(太旧)
	*/
	function support($hashed){
		$data = explode('$',$hashed);
		if (count($data)<=1){
			return false;
		}
		if (!in_array($data[1],self::$support_id)){
			return false;
		}
		return true;
	}
}
